/**
 * 
 */
package ru.olympus.antonyhands.ao.data.util;

import java.util.Comparator;

import ru.olympus.antonyhands.ao.data.entities.AOItem;

/**
 * @author anna
 *
 */
public class ByCraftLevelComparator implements Comparator<AOItem> {

	@Override
	public int compare(AOItem left, AOItem right) {
		Long leftLevel = left.getCraftInfo() == null ? 0 : left.getCraftInfo().getCraftLevel();
		Long rightLevel = right.getCraftInfo() == null ? 0 : right.getCraftInfo().getCraftLevel();
		return leftLevel.compareTo(rightLevel);
	}

}
